HAL PWR types migration

This section provides information about the HAL PWR types migration .

HAL PWR PVD type definition

HAL1

HAL2

PWR_PVDTypeDef

New usage sequence

typedef struct
{



  uint32_t PVDLevel;



  uint32_t Mode;


} PWR_PVDTypeDef;
/*list of possible values to use instead of PVDLevel momber*/
typedef enum
{
  HAL_PWR_PVD_LEVEL_0 = LL_PWR_PVDLEVEL_0,
  HAL_PWR_PVD_LEVEL_1 = LL_PWR_PVDLEVEL_1,
  HAL_PWR_PVD_LEVEL_2 = LL_PWR_PVDLEVEL_2,
  HAL_PWR_PVD_LEVEL_3 = LL_PWR_PVDLEVEL_3
} hal_pwr_pvd_level_t;
  • For mode configuration use HAL EXTI to configure the corresponding EXTI_line

    Related use case: ref:hal_pwr_pvd_with_exti_wakeup

Related concept: Remove EXTI Intrinsic Management in System HAL Drivers; Let Users Rely on EXTI HAL Driver.


HAL PWR AVD type definition

HAL1

HAL2

PWREx_AVDTypeDef

New usage sequence

typedef struct
{


  uint32_t AVDLevel;



  uint32_t Mode;


} PWR_AVDTypeDef;
/*list of possible values to use instead of AVDLevel momber*/
typedef enum
{
  HAL_PWR_AVD_VDDA_LEVEL_0 ,
  HAL_PWR_AVD_VDDA_LEVEL_1 ,
} hal_pwr_avd_level_t;

Note

For mode configuration use HAL EXTI to configure the corresponding EXTI_line , they follow the same principles as PVD monitoring.

Related use case: ref: hal_pwr_pvd_with_exti_wakeup

Related concept: Remove EXTI Intrinsic Management in System HAL Drivers; Let Users Rely on EXTI HAL Driver.


HAL PWR PVM type definition

HAL1

HAL2

PWR_PVMTypeDef

New usage sequence

typedef struct
{


  uint32_t PVMType;



  uint32_t Mode;


} PWR_AVDTypeDef;
/*list of possible values to use instead of PVMType momber*/



#define HAL_PWR_VDD_ANALOG_MONITOR_1  LL_PWR_ANALOG_VOLTAGE_MONITOR_1
#define HAL_PWR_VDD_ANALOG_MONITOR_2  LL_PWR_ANALOG_VOLTAGE_MONITOR_2
...

Note

For mode configuration use HAL EXTI to configure the corresponding EXTI_line, they follow the same principles as PVD monitoring.

Related use case: ref: hal_pwr_pvd_with_exti_wakeup

Related concept: Remove EXTI Intrinsic Management in System HAL Drivers; Let Users Rely on EXTI HAL Driver.


HAL PWR wake-up pin type definition

HAL1

HAL2

PWREx_WakeupPinTypeDef

New usage sequence

typedef struct
{


  uint32_t WakeUpPin;








  uint32_t PinPolarity;







  uint32_t PinPull;



} PWREx_WakeupPinTypeDef;

list of possible values to use instead of AVDLevel momber :

/*WakeUpPin list of possible values*/

#define HAL_PWR_WAKEUP_PIN_1   LL_PWR_WAKEUP_PIN1
#define HAL_PWR_WAKEUP_PIN_2   LL_PWR_WAKEUP_PIN2
#define HAL_PWR_WAKEUP_PIN_3   LL_PWR_WAKEUP_PIN3
...

/*PinPolarity list of possible values*/

typedef enum
{
  HAL_PWR_WAKEUP_PIN_POLARITY_LOW  = LL_PWR_WAKEUP_PIN_POLARITY_LOW,
  HAL_PWR_WAKEUP_PIN_POLARITY_HIGH = LL_PWR_WAKEUP_PIN_POLARITY_HIGH
} hal_pwr_wakeup_pin_polarity_t;

/*PinPull list of possible values*/

typedef enum
{
  HAL_PWR_GPIO_NOPULL   = 0U,
  HAL_PWR_GPIO_PULLUP   = 1U,
  HAL_PWR_GPIO_PULLDOWN = 2U
} hal_pwr_gpio_pull_t;

Related concept: Add HAL_PPP Prefix to All HAL Peripheral APIs (Defines, Macros, Types, and Functions).